package com.isunland.managesystem.ui;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.MenuItem;
import com.isunland.managesystem.R;
import com.isunland.managesystem.base.BasePagerActivity;
import com.isunland.managesystem.entity.RProInvoiceRecd;

public class EnterprisePagerActivity extends BasePagerActivity {

  private EnterpriseListFragment mReceiptInfoFragmentOne;
  private EnterpriseListFragment mReceiptInfoFragmentTwo;
  private EnterpriseListFragment mReceiptInfoFragmentThree;

  private int[] mTitleId = {
      R.string.supplier, R.string.customer, R.string.otherCommunicateUnits
  };
  private RProInvoiceRecd mDetail;

  @Override protected void onCreate(Bundle arg0) {
    //		 mDetail=(RProInvoiceRecd)getIntent().getSerializableExtra(ReceiptInfoFragment.EXTRA_RECEIPT);
    super.onCreate(arg0);
  }

  @Override protected Fragment createFragmentOne() {
    mReceiptInfoFragmentOne =
        EnterpriseListFragment.newInstance(EnterpriseListFragment.VALUE_SUPPLIER);
    return mReceiptInfoFragmentOne;
  }

  @Override protected Fragment createFragmentTwo() {
    mReceiptInfoFragmentTwo =
        EnterpriseListFragment.newInstance(EnterpriseListFragment.VALUE_CUSTOMER);
    return mReceiptInfoFragmentTwo;
  }

  @Override public Fragment createFragmentThree() {
    mReceiptInfoFragmentThree =
        EnterpriseListFragment.newInstance(EnterpriseListFragment.VALUE_OTHER_CUSTOMER);
    return mReceiptInfoFragmentThree;
  }

  @Override protected int[] createTitle() {

    return mTitleId;
  }

  @Override public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
      case android.R.id.home:
        finish();
        break;

      default:
        break;
    }
    return true;
  }
}
